A typical computer system includes performance analysis tools which enable a user such as a system administrator to obtain general performance information describing the operation of the computer. One type of tool enables the system administrator to obtain a snapshot of how much a computer utilizes a particular computer resource (e.g., a processor, a disk or a network resource) at a particular point in time. For example, a typical computer running the UNIX operating system includes utilities for measuring current central processing unit (CPU) utilization (e.g., xe2x80x9ccpustatxe2x80x9d), disk traffic (e.g., xe2x80x9ciostatxe2x80x9d) and network loading (e.g., xe2x80x9cnetstatxe2x80x9d).
In general, each of the above-described tools provides an indication of how much a particular resource is utilized overall within the computer. That is, each tool provides an indication of how much the particular resource is used as a whole, irrespective of which or how many users, processes or programs utilize the particular resource.
In contrast to the above-described tools which provide indications of how much the resources are utilized overall, another type of tool enables a user to run a program and obtain detailed information describing the performance of that program. For example, the UNIX xe2x80x9cprofxe2x80x9d facility generally works by sampling the program counter several times each second and incrementing a counter each time the computer enters a particular target routine. Another UNIX facility called xe2x80x9cgprofxe2x80x9d operates in a similar manner but also determines which routine or routines call the particular target routine. Accordingly, the user can run the program for a period of time, and determine approximately how much time is spent in the target routine during that period.
Specialized computer systems may include specialized performance analysis tools for obtaining specific performance information describing the operation of the computer. A specialized computer known as a data communications device (e.g., a router, switch, bridge, etc.) typically includes a utility that enables a network administrator to categorize and count packets processed by the data communications device. Such a utility typically examines an aspect of each packet (or packet sample), and categorizes that packet into one of multiple categories or classes based on that aspect, e.g., by size, source address, destination address, priority, Quality of Service (QoS) class, etc. The utility increments counters corresponding to these categories in order to count the number of packets processed for each category.
For example, a data communications device running a performance analysis utility may categorize and count packets based on QoS class. To this end, the data communications device may use three respective counters to count the number of video QoS packets, audio QoS packets and best efforts QoS packets that the device processes over a period of time. A network administrator can then study the information in these counters to gauge the character of network traffic handled by the data communications device, and then manually configure the data communications device to operate in a more optimized manner on similar network traffic in the future.
Some computers operate by processing individual data elements (e.g., request signals, messages, network data structures, etc.). During operation, such a computer may process the data elements using different combinations of resources based on particular circumstances. For example, when a disk server receives a request (a data element) to write a block of data to a set of disks, the disk server may be able to perform a simple write operation by generating parity information for the data block, and then writing the data block and parity information to the set of disks. However, when the disk server receives a request to write a small portion of a data block on the disks, the disk server may need to perform a read-modify-write operation by reading an existing data block from the set of the disks, performing a modification routine which modifies part of the read data block with the small portion of the data block, generating parity information for the modified data block, and then storing the modified data block on the disks. Accordingly, the disk server may use resources (e.g., the modification routine) in certain situations but not others.
Similarly, a data communications device typically processes network data structures (data elements) by conveying the network data structures (e.g., packets, frames or cells) from one portion of a network to another. When the data communications device processes these data elements, the data communications device may use different combinations of resources depending on certain circumstances. For example, for certain network data structures, the data communications device may utilize a particular decapsulation or decryption routine to extract routing information from those network data structures. To obtain routing information for other data elements such decapsulation or decryption routines may be unnecessary. Accordingly, the data communications device may use particular resources for certain situations but not others in a manner similar to that of disk servers.
Unfortunately, conventional performance analysis tools generally do not provide resource usage information on a data element by data element basis. For example, a conventional performance analysis tool such as xe2x80x9ciostatxe2x80x9d, which measures disk traffic to one or more disks, does not provide resource usage information about which combinations of resources are used to process each disk access operation. Similarly, a conventional performance tool such as xe2x80x9cprofxe2x80x9d, which indicates how long a program executes in a particular routine, does not provide resource usage information about which resources are used to process a particular data element processed by the program.
In contrast to conventional performance analysis tools, the invention is directed to techniques for measuring resource usage of a computer when processing a data element, using a usage field assigned to the data element.
In one arrangement, the computer includes multiple resources, memory and a controller which is coupled to the multiple resources and the memory. The controller operates in accordance with an application stored in the memory to process data elements using different combinations of the multiple resources. In particular, the application configures the controller to assign a usage field to a data element, process the data element using a combination of the multiple resources, and adjust contents of the assigned usage field to identify particular resources of the combination in order to measure resource usage of the computer when processing the data element. The computer can operate in a similar manner to process other data elements in order to obtain resource usage information on a data element by data element basis. Accordingly, the resource usage information can be used to identify bottlenecks, optimize resource allocation, and resolve performance problems. As a result, the invention can assist capacity planning and improve computer system serviceability, reliability and performance.
The resources can be either hardware-based (e.g., a physical component) or software-based (e.g., a logical construct). Some examples of hardware-based resources are port buffers, hardware circuitry and peripheral devices. Some examples of software-based resources are allocatable data structures, specialized algorithmic routines, and decapsulation/encapsulation, decryption/encryption, and decoding/encoding routines.
In one arrangement, the controller includes markers which modify the contents of the usage field in response to processing the data element using different sets of resources. For example, a first marker can modify the usage field (e.g., set a first bit of the usage field) in response to processing the data element using a first set of resources (e.g., decapsulation and decryption routines). Then, a second marker can re-modify the contents of the usage field (e.g., set a second bit of the usage field) in response to processing the data element using a second set of resources (e.g., encryption and encapsulation routines).
In one arrangement, the application configures the controller to process the data elements using the multiple resources by arranging the resources as nodes which form multiple nodal pathways. In this arrangement, the controller processes the data element by passing the data element among resources belonging to a particular nodal pathway of multiple nodal pathways. To initiate collection of resource usage information, the application configures the controller to dynamically insert a marker as a node at a particular point along the particular nodal pathway. Once the marker is in place, the marker adjusts the contents of the usage field assigned to the data element as the data element passes the particular point along the particular nodal pathway. The controller can later remove the marker from the particular nodal pathway to stop collection of usage information. Accordingly, the controller can dynamically start and dynamically terminate collection of resource usage information.
In another arrangement, the markers pre-exist prior to initiating collection of resource usage information but are dormant. Then, to begin collection of resource usage information, the controller (under direction of the application) activates the pre-existing markers. That is, the controller provides signals to the pre-existing markers to transition the pre-existing markers from their dormant states, in which the pre-existing markers are unable to adjust the contents of the usage field assigned to the data element, to ready states, in which the pre-existing markers are able to adjust the contents of the usage field assigned to the data element. In a similar manner, the controller can inactivate the pre-existing markers. Preferably, the controller can activate or deactivate the pre-existing markers while processing data elements, i.e., dynamically. Furthermore, the controller preferably can activate and/or deactivate the pre-existing markers individually or in groups.
Preferably, the memory of the computer further stores, among other things, a resource usage database. The controller updates the resource usage database according to the contents of the usage field assigned to the data element. There are various arrangements for updating the resource usage database based on the contents of the usage field.
In one arrangement, the controller includes a collector which forms an identifier from the contents of the usage field. The identifier points to a memory location within the resource usage database (e.g., a counter). Accordingly, the collector can index and update memory locations of the resource usage database based on the contents of the usage field assigned to the data element.
In another arrangement, the controller includes a collector which forms, from the contents of the usage field, an identifier which identifies a routine within the resource usage database. Accordingly, the collector can select and execute routines of the resource usage database based on the contents of the usage field.
In yet another arrangement, the controller includes a collector that performs a combinatorial operation (e.g., one or more Boolean operations) using the contents of the usage field. The collector then modifies the resource usage database according to a result of the combinatorial operation.
The controller can include multiple collectors which access the usage field as the computer processes the data element. For example, the controller may include a first collector which updates a resource usage database according to the contents of the usage field assigned to the data element after the data element is processed by a first set of resources. The controller may further include a second collector which further updates the resource usage database according to the contents of the usage field assigned to the data element after the data element is processed by a second set of resources. In one arrangement, the controller activates and deactivates the collectors using signals in a manner similar to the arrangement which involves activating and deactivating markers. In another arrangement which is similar to the arrangement which inserts and removes markers, the resources of the computer form nodal pathways, and the controller inserts collectors within nodal pathways to collect resource usage information and removes the collectors from the nodal pathways to terminate collection of the resource usage information.
Preferably, the application further configures the controller to update the resource usage database according to contents of other usage fields assigned to other data elements. As such, the resource usage database stores resource usage information about the computer when processing multiple data elements. In one arrangement, the computer uses information stored in the resource usage database to control its operation. In particular, the application configures the controller to automatically tune operating parameters of the computer based on the resource usage database to improve operating efficiency of the computer.
One arrangement of the invention is directed to a computer program product that includes a computer readable medium having instructions stored thereon for measuring resource usage of a computer having multiple resources and being capable of processing data elements using different combinations of the multiple resources. When the computer carries out the instructions, the instructions cause the computer to perform the steps of assigning a usage field to a data element, processing the data element using a combination of the multiple resources, and adjusting contents of the assigned usage field to identify particular resources of the combination in order to measure resource usage of the computer when processing the data element. Accordingly, the computer program product facilitates collection of resource usage information in a computer on a data element by data element basis.
Preferably, the step of adjusting includes the steps of modifying the contents of the usage field in response to processing the data element using a first set of resources, and re-modifying the contents of the usage field in response to processing the data element using a second set of resources.
Additionally, the instructions preferably further cause the computer to perform the steps of updating a resource usage database according to the contents of the usage field assigned to the data element, and updating the resource usage database according to contents of another usage field assigned to another data element in order to store resource usage information about the computer when processing multiple data elements.
Furthermore, the instructions preferably further cause the computer to update the resource usage database according to the contents of the usage field assigned to the data element after the data element is processed by a first set of resources, and further update the resource usage database according to the contents of the usage field assigned to the data element after the data element is processed by a second set of resources.
The features of the invention, as described above, may be employed in data communications devices and other computerized devices such as those manufactured by Cisco Systems, Inc. of San Jose, Calif.